package com.example.vspm.mapper;

import com.example.vspm.entity.ExecutiveReport;
import com.example.vspm.entity.MeetingPlace;
import com.example.vspm.service.impl.ExecutiveReportImpl;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author LCL
 * @date 2022/3/13
 * @desc
 */
@Repository
@Mapper
public interface ExecutiveReportMapper {

    //插入执行报告,根据工单id
    @Insert("insert into vspm_executiveReport (taid,executionCategory,executionName,executionContent) values" +
            "(#{taid},#{executionCategory},#{executionName},#{executionContent})")
    @Options(useGeneratedKeys=true, keyProperty="tid", keyColumn="tid")
    void addExecutiveReport(@Param("taid") int taid, ExecutiveReport executiveReport);

    //查看执行报告,根据前端穿的工单taid  666666666666
    @Select("select * from vspm_executiveReport where executionCategory in" +
            "(select executionCategory from vspm_executiveReport WHERE taid=#{taid})")
    List<ExecutiveReport> listExecutiveReportByTid(@Param("taid") int taid);

}
